package models

// 获取管理员
func GetAdmin() (Admin, error) {
	var admin Admin
	err := db.First(&admin).Error
	return admin, err
}

// 保存管理员
func SaveAdmin(admin Admin) (Admin, error) {
	err := db.Save(&admin).Error
	return admin, err
}

type Admin struct {
	Id    uint   `gorm:"primarykey" json:"id"`
	Name  string `gorm:"type:varchar(50);default:''" json:"name"`
	Email string `gorm:"type:varchar(100);default:''" json:"email"`
	Image string `gorm:"default:''" json:"image"`
}
